<?php
	echo "
					<!-- CONTACTS BOX -->
					<div id='supportID' style='display: none;' >
						<div class='lp1 lpad10 rpad10 bpad10'><span class='size18'>".Language::Get('Support')."</span><span id = 'supportResultContainer' class = 'success'></span></div>
					  	<div class='lpad10 rpad10 tpad10'>";

	echo '<form action = "#" method = "POST" id = "supportForm" onsubmit = "if (ValidateSupport()) { $(\'#btnSupport\').hide(); $(\'#loaderImage\').show(); '.jQuery::Post('/home/support/', 'supportForm', 'AfterSupport').'} return false; ">';
	echo "
    	<table cellpadding='0' cellspacing='0' width='100%' style = 'margin-bottom: 3px; '>
        	<tr class='' name = 'staticRow'>
            	<td align='left' class='tpad5 bpad5'><span class='c6a'>".Language::Get('Question')."*: </span></td>
          	</tr>
          	<tr class='lp1' name = 'inputRow' style = ''>
		    	<td colspan='2' class='bpad10 dq-input-text'>";
		    		XHTML::InputText('support_question', '', array('style' => 'width: 100%'));
	echo "		</td>
		  	</tr>
        	<tr class='' name = 'staticRow'>
            	<td align='left' class='tpad5 bpad5'><span class='c6a'>".Language::Get('Details')."*: </span></td>
          	</tr>
          	<tr class='lp1' name = 'inputRow' style = ''>
		    	<td colspan='2' class='bpad10'>";
					XHTML::Textarea('support_details', '', array('style' => 'border: 1px solid #CCCCCC; width: 100%; height: 150px; padding: 3px; '));
	echo "		</td>
		  	</tr>
        	<tr class='' name = 'staticRow'>
            	<td align='left' class='tpad5 bpad5'><span class='c6a'>".Language::Get('Name')."*: </span></td>
          	</tr>
          	<tr class='lp1' name = 'inputRow' style = ''>
		    	<td colspan='2' class='bpad10 dq-input-text'>";
		    		XHTML::InputText('support_name', '', array('style' => 'width: 100%'));
	echo "		</td>
		  	</tr>
        	<tr class='' name = 'staticRow'>
            	<td align='left' class='tpad5 bpad5'><span class='c6a'>".Language::Get('Email')."*: </span></td>
          	</tr>
          	<tr class='lp1' name = 'inputRow' style = ''>
		    	<td colspan='2' class='bpad10 dq-input-text'>";
		    		XHTML::InputText('support_email', $_SESSION['client']['login'], array('style' => 'width: 100%'));
	echo "		</td>
		  	</tr>
		</table>
        <div class = 'c6a' style = 'margin-bottom: 10px; '>".Language::Get('Required fields')."</div>
        </form>
        
        <div id='btnSupport'>".Language::Get('Submit', 'CAPITALIZE')."</div>
	";
	XHTML::Img(SITE_IMAGES.'loader16x16.gif', 'alt', array('id' => 'loaderImage', 'style' => 'display: none;'));
	
	echo "			  	</div>
					  	</form>
					</div>
					<!-- /CONTACTS BOX -->	
	";
?>

<script type="text/javascript">
	$('#supportID').dqDialog({});	
	$('#btnSupport').dqButton({type:5, action:"$('#supportForm').submit();", clickType:'js', live: false});
	$('#supportID .btnType-5-left').addClass('btnType-5-left-select');	
	$('#supportID .btnType-5-center').addClass('btnType-5-center-select');	
	$('#supportID .btnType-5-right').addClass('btnType-5-right-select');	
	$('#supportID .btnType-3-left').addClass('btnType-3-left-select');	
	$('#supportID .btnType-3-center').addClass('btnType-3-center-select');	
	$('#supportID .btnType-3-right').addClass('btnType-3-right-select');	
//	$('.dq-input-text').dqInput();

	//validates support form
	function ValidateSupport()
	{
		if (($('[name=support_question]').val() == '') || ($('[name=support_details]').val() == '') || ($('[name=support_name]').val() == '') || 
			($('[name=support_email]').val() == ''))
		{
			alert('Please, fill all the required fields');
			return false;
		}
		else
		{
			return true;
		}
	}

	//after support message sent
	function AfterSupport(data)
	{
		$('#loaderImage').hide();
		$('#btnSupport').show();
		$('#supportResultContainer').html(data);
	}
</script>